/**
 * 自定义表单验证器
 *
 */

 import { FormControl, ValidationErrors, ValidatorFn } from '@angular/forms';
//  import { ErrorTip } from './';
 
 
 export class FormValidator {


    static lname(control: FormControl): ValidationErrors | null {

        let str = control.value;
      let reg=/^[a-z\u4e00-\u9fa5][-a-z0-9\u4e00-\u9fa5\.\_]{0,58}[a-z0-9\u4e00-\u9fa5]$/;
      if(reg.test(str)){
      //  console.log("tongg ");
        // return {islayername : true};
        // console.log(isLayerName)
        // this.isLayerName = true;
        return null;
      }else{
        // console.log("no");
        // this.isLayerName = false;
        return { formatErr: '请输入正确的标题' };
        
      }


       
        
      }
    


 }
 